<?php
/**
 * PsiFramework
 *
 * Php Simple Framework
 *
 * PHP version 5.3
 *
 * @category  PsiFramework.Plugins.Shop.Classes.Model
 * @package   PsiFramework.Plugins.Shop.Classes.Model
 * @author    Remi San <remi.san@gmail.com>
 * @copyright 2011 Remi San
 * @license   http://creativecommons.org/licenses/by/3.0/  Creative Commons CC BY 3.0
 * @version   SVN: <svn_id>
 * @link      http://www.psiframework.com/phpdoc/classes/db_\PsiFramework\Plugins\Shop\Classes\Model\Tax.html
 */

namespace PsiFramework\Plugins\Shop\Classes\Model;

import("Classes.Model.Object");
import("Classes.Util.Parameters.ObjectParameters");

use \PsiFramework\Classes\Model\Object;
use \PsiFramework\Classes\Util\Parameters\ObjectParameters;

/**
 * The Tax Object
 *
 * This is the class for the Tax Object
 *
 * @category PsiFramework.Plugins.Shop.Classes.Model
 * @package  PsiFramework.Plugins.Shop.Classes.Model
 * @author   Remi San <remi.san@gmail.com>
 * @license  http://creativecommons.org/licenses/by/3.0/  Creative Commons CC BY 3.0
 * @link     http://www.psiframework.com/phpdoc/classes/db_\PsiFramework\Plugins\Shop\Classes\Model\Tax.html
 */
class Tax extends Object
{

    /**
     * @var int
     */
    protected /*int*/    $_id ;
    
    /**
     * @var string
     */
    protected /*string*/ $_key ;
    
    /**
     * @var string
     */
    protected /*string*/ $_name ;
    
    /**
     * @var double
     */
    protected /*double*/ $_value ;
    
    /**
     * @var bool
     */
    protected /*bool*/         $_percentage ;
    
    /**
     * Constructor
     * 
     * @param int    $id         The id
     * @param string $key        The key
     * @param string $name       The name
     * @param double $value      The symbol
     * @param bool   $percentage Is the value a percentage ?
     * 
     * @return Tax
     */
    public function __construct(
        /*int*/    $id=null,
        /*string*/ $key=null,
        /*string*/ $name=null,
        /*double*/ $value=null,
        /*bool*/   $percentage=null
    )
    {
        $this->_id = $id ;
        $this->_key = $key ;
        $this->_name = $name ;
        $this->_value = $value ;
        $this->_percentage = $percentage ;
    }

    /**
     * Getter for the id / primary key
     *
     * @see Object::getId()
     *
     * @return int
     */
    public function getId()
    {
        return $this->_id ;
    }

    /**
     * Setter for the id
     *
     * @param int $id The id
     *
     * @return void
     */
    public function setId(/*int*/ $id)
    {
        $this->_id = $id ;
    }
    
    /**
     * Getter for the key
     *
     * @return string
     */
    public function getKey()
    {
    	return $this->_key ;
    }
    
    /**
     * Setter for the key
     *
     * @param string $key The key
     *
     * @return void
     */
    public function setKey(/*string*/ $key)
    {
    	$this->_key = $key ;
    }
    
    /**
     * Getter for the name
     *
     * @return string
     */
    public function getName()
    {
    	return $this->_name ;
    }
    
    /**
     * Setter for the name
     *
     * @param string $name The name
     *
     * @return void
     */
    public function setName(/*string*/ $name)
    {
    	$this->_name = $name ;
    }
    
    /**
     * Getter for the value
     *
     * @return double
     */
    public function getValue()
    {
    	return $this->_value ;
    }
    
    /**
     * Setter for the value
     *
     * @param double $value The value
     *
     * @return void
     */
    public function setValue(/*double*/ $value)
    {
    	$this->_value = $value ;
    }
    
    /**
     * Is the value a percentage ?
     *
     * @return bool
     */
    public function isPercentage()
    {
    	return $this->_percentage ;
    }
    
    /**
     * Setter for the percentage
     *
     * @param bool $percentage is it a percentage ?
     *
     * @return void
     */
    public function setPercentage(/*bool*/ $percentage)
    {
    	$this->_percentage = $percentage ;
    }
    
    /**
     * Shows the Tax as a string
     *
     * @see Object::toString()
     *
     * @return string
     */
    public function toString()
    {
        return $this->_symbol;
    }

}
